function minSubsequence(nums: number[]): number[] {
    nums.sort((a,b) => b-a)
    const sum: number = nums.reduce((sum ,item) => sum+=item,0)/2
    const result: number[] = []
    let resultSum: number = 0
    nums.forEach(item => {
        if(resultSum <= sum) {
            result.push(item)
            resultSum += item
        }
    })
    return result
};

const nums: number[] = [4,3,10,9,8]
console.log(minSubsequence(nums))